<!DOCTYPE html>
<html lang="en">
<head>
    <title>{$site_name}</title>
    <meta name="keywords" content="{$site_seo_keywords}" />
    <meta name="description" content="{$site_seo_description}">
    <tc_include file="Public:head" />
    <style>
       #professor_form .submit_professor{
            border: none;
            width: 60px;
            height: 30px;
            border-radius: 10px;
            color: #FFF;
            background-color: #000232;
            text-align: center;
            line-height: 30px;
            font-weight: bold;
            letter-spacing: 2px;
            margin-top: 26px;
            margin: 0 auto;
            display: block;
       }
       #professor_form .introduce {
        margin-bottom: 12px;
       }
        .tit{color:#555;}
       .ellipsis2 {overflow: hidden; text-overflow:ellipsis; display: -webkit-box; -webkit-line-clamp: 2;-webkit-box-orient: vertical;}
       .list-group {
           margin-left: 20px;
       }
       /*个人的中心布局样式调整*/
       .container {
           width: 1190px;
       }
       .row {
           margin-left: 0px;

       }
       .span3 {
           margin-left: 0;
           width: 280px;
       }
       .span9 {
           width: 830px;
           margin-left: 14px;
       }

       .hidden {
           display: none;
       }

       /*
       .container .title{
           font-size: 16px;
           color: #000232;
           line-height: 48px;
           padding-left: 60px;
           border-bottom: 1px solid #676884;
           margin-bottom: 18px;
       }

      */
       /*个人的中心布局样式调整结束*/
    </style>
</head>
<body>
    <tc_include file="Public:nav" />

    <div class="container tc-main">
        <div class="row">
            <div class="span3">
                <tc_include file="Public:usernav"/>
            </div>
            <div class="alone_center span9">
                <div class="alone_right">
                    <form method="post" action="{:U('professor/professor/professor_edit')}" id="professor_form">

                        <!--专栏作者详细介绍-->
                        <div class="introduce">
                            <p class="introduce_title">详细介绍</p>
                            <textarea class="introduce_text" name="introduction" placeholder="详细介绍">{$professor_info.introduction}</textarea>
                        </div>
                        <button type="button" class="submit_professor">完成</button>
                    </form>
                    <!--企业介绍-->
                    <div class="experience">
                        <p class="introduce_title">企业介绍</p>
                        <ul class="project_ul">
                            <!--模板-->
                            <li class="experience_item project enterprise company_edit" style="display: block;">
                                <input value="{$id}" id="user_id" hidden>
                                <p class="tit">
                                    <i>企业名称</i>
                                    <input style="font-weight: bold;" class="project_name" id="company" placeholder="公司名称" value="{$company}" readonly>
                                </p>
                                <p  class="tit">
                                    <i>公司官网</i>
                                    <if condition="!empty($company_link)">
                                        <a id="company_link_a" href="javascript:;" style="text-decoration : underline">{$company_link}</a>
                                    </if>
                                    <input id="company_link" placeholder="公司官网" value="{$company_link}" readonly class="{:empty($company_link) ? '' : 'hidden'}">
                                </p>
                                <p  class="tit">
                                    <i>成立时间</i><input id="company_start_time" type="date" placeholder="时间" style="margin-bottom: 0;" value="{$company_start_time}" readonly>
                                </p>
                                <p  class="tit">
                                    <i>公司地址</i><input id="company_addr" placeholder="公司地址" value="{$company_addr}" readonly>
                                </p>
                                <p  class="tit">
                                    <i>公司规模</i>
                                    <!--<input id="company_scale" placeholder="公司规模" value="{$scale}" readonly>-->
                                    <select name="company_scale" id="company_scale" readonly="">
                                        <option value="0" {$company_scale == 0 ? 'selected' : ''}>不明确</option>
                                        <option value="20" {$company_scale <= 20 && $company_scale > 0 ? 'selected' : ''}>1 ~ 20</option>
                                        <option value="100" {$company_scale <= 100 && $company_scale > 20 ? 'selected' : ''}>20 ~ 100</option>
                                        <option value="500" {$company_scale <= 500 && $company_scale > 100 ? 'selected' : ''}>100 ~ 500</option>
                                        <option value="1000" {$company_scale <= 1000 && $company_scale > 500 ? 'selected' : ''}>500 ~ 1000</option>
                                        <option value="5000" {$company_scale <= 5000 && $company_scale > 1000 ? 'selected' : ''}>1000 ~ 5000</option>
                                        <option value="99999" {$company_scale > 5000 ? 'selected' : ''}>5000以上</option>
                                    </select>
                                </p>
                                <div class="tit">
                                    <i style="position: relative;top: 3px;" >详情介绍</i>
                                    <textarea class="input_text project_desc" placeholder="详情描述……" style="resize: none; color: #333333;margin-top: -17px;border: 1px solid #707070;padding:0 5px" id="company_introduction" readonly>{$company_introduction}</textarea>
                                </div>
                                <div class="xgsc">
                                    <a href="javascript:;" class="modify_company">修改</a>
                                    <a href="javascript:;" class="modify_company_save">保存</a>
                                </div>
                            </li>
                        </ul>
                    </div>

                    <!--项目经历-->
                    <div class="experience">
                        <p class="introduce_title">项目描述</p>
                        <ul class="project_ul">

                            <!--模板-->
                            <li class="experience_item project" style="display: none">
                                <p class="tit"><i>项目名称</i><span style="font-weight: bold;" class="project_name">project_name</span></p>
                                <p  class="tit">
                                    <i>时间</i><span class="timer start_time">start_time</span><span class="timer end_time">end_time</span>
                                </p>
                                <div class="tit">
                                    <i style="position: relative;top: 3px;" >经历描述</i>
                                    <p class="input_text project_desc ellipsis2"  style="color: #333333;margin-top: -17px;border: 1px solid #707070;padding:0 5px">
                                    </p>
                                </div>
                                <div class="xgsc">
                                    <a href="javascript:;" class="add_project" data-id="{$vo.id}">修改</a>
                                    <a href="javascript:;" class="del_pf_info" data-action="project" data-id="{$vo.id}">删除</a>
                                </div>
                            </li>

                            <!--数据-->
                            <volist name="pf_project" id="vo">
                                <li class="experience_item project" id="project_{$vo.id}">
                                    <p class="tit"><i>项目名称</i><span style="font-weight: bold;" class="project_name">{$vo.project_name}</span></p>
                                    <p  class="tit"><i>时间</i><span class="timer start_time">{$vo.start_time}</span><span class="timer end_time">{$vo.end_time|default='至今'}</span>
                                    </p>
                                    <div class="tit">
                                        <i style="position: relative;top: 3px;" >经历描述</i>
                                        <p  class="input_text project_desc ellipsis2"  readonly style="color: #333333;margin-top: -17px;border: 1px solid #707070;padding:0 5px">
                                            {$vo.project_desc}
                                        </p>
                                    </div>
                                    <div class="xgsc">
                                        <a href="javascript:;" class="add_project" data-id="{$vo.id}">修改</a>
                                        <a href="javascript:;" class="del_pf_info" data-action="project" data-id="{$vo.id}">删除</a>
                                    </div>
                                </li>
                            </volist>

                        </ul>
                        <p class="alone_size add_project"><span class="introduce_modify">添加</span></p>
                    </div>


                    <!--教育经历-->
                    <div class="experience">
                        <p class="introduce_title">教育经历</p>
                        <ul class="education_ul">

                            <li class="experience_item education" style="display: none">
                                <p class="tit"><i>学校</i><span style="font-weight: bold;" class="school">school</span></p>
                                <p  class="tit">
                                    <i style="margin-right: 6px;">时间</i><span class="timer start_time">start_time</span><span class="timer end_time">end_time</span><i>学位：</i><span class="degree">degree</span><i>专业：</i> <span class="major">major</span>
                                </p>
                                <div class="tit">
                                    <i style="position: relative;top: 3px;" >经历描述</i>
                                    <p class="input_text experience ellipsis2"  style="color: #333333;margin-top: -17px;border: 1px solid #707070;padding:0 5px">
                                    </p>
                                </div>

                                <div class="xgsc">
                                    <a href="javascript:;" class="add_education" data-id="{$vo.id}">修改</a>
                                    <a href="javascript:;" class="del_pf_info" data-action="education" data-id="{$vo.id}">删除</a>
                                </div>
                            </li>

                            <volist name="pf_education" id="vo">
                                <li class="experience_item education" id="education_{$vo.id}">
                                    <p class="tit"><i>学校</i><span style="font-weight: bold;" class="school">{$vo.school}</span></p>
                                    <p  class="tit"><i>时间</i> <span class="timer start_time">{$vo.start_time}</span><span class="timer end_time">{$vo.end_time|default='至今'}</span><i>学位：</i> <span class="degree">{$vo.degree}</span><i>专业：</i> <span class="major">{$vo.major}</span>
                                    </p>
                                    <!--<p class="tit">-->
                                        <!--<i style="position: relative;top: 3px;">经历描述</i>-->
                                        <!--<input type="text" class="input_text experience" value="{$vo.experience}" readonly>-->
                                    <!--</p>-->
                                    <div class="tit">
                                        <i style="position: relative;top: 3px;" >经历描述</i>
                                        <p class="input_text experience ellipsis2"  style="color: #333333;margin-top: -17px;border: 1px solid #707070;padding:0 5px">
                                            {$vo.experience}
                                        </p>
                                    </div>
                                    <div class="xgsc">
                                        <a href="javascript:;" class="add_education" data-id="{$vo.id}">修改</a>
                                        <a href="javascript:;" class="del_pf_info" data-action="education" data-id="{$vo.id}">删除</a>
                                    </div>
                                </li>
                            </volist>
                        </ul>
                        <p class="alone_size add_education"><span class="introduce_modify">添加</span></p>
                    </div>


                    <!--出版作品-->
                    <div class="experience">
                        <p class="introduce_title" style="margin-top: 30px;">出版作品</p>

                        <ul class="publish_ul">
                            <!--模板-->
                            <li class="publish_item publish_li" style="display: none;">
                                <p class="tit"><i>作品名称:</i><span style="font-weight: bold;margin-left: 17px;" class="article_name"></span></p>
                                <p class="tit">
                                    <ul style="width: 100%;margin-left: -1px;">
                                        <li style="width: 240px;float: left;"><i>出版刊物：</i> <span class="magazine"></span></li>
                                        <li style="width: 270px; float: left;"><i>出版时间：</i> <span class="publish_time"></span></li>
                                        <li style="width: 300px; float: left;"><i>出版社：</i> <span class="publish_house"></span></li>
                                    </ul>
                                </p>
                                <div class="xgsc">
                                    <a href="javascript:;" class="add_publish">修改</a>
                                    <a href="javascript:;" class="del_pf_info" data-action="publish">删除</a>
                                </div>
                            </li>

                            <!--数据-->
                            <volist name="pf_publish" id="vo">
                                <li class="publish_item publish_li" id="publish_{$vo.id}">
                                    <p class="tit"><i>作品名称:</i><span style="font-weight: bold;margin-left: 17px;" class="article_name">{$vo.article_name}</span></p>
                                    <p class="tit">
                                        <ul style="width: 100%;margin-left: -1px;">
                                            <li style="width: 240px;float: left;"><i>出版刊物：</i> <span class="magazine">{$vo.magazine}</span></li>
                                            <li style="width: 270px; float: left;"><i>出版时间：</i> <span class="publish_time">{$vo.publish_time}</span></li>
                                            <li style="width: 300px; float: left;"><i>出版社：</i> <span class="publish_house">{$vo.publish_house}</span></li>
                                        </ul>
                                    </p>
                                    <div class="xgsc">
                                        <a href="javascript:;" class="add_publish" data-id="{$vo.id}">修改</a>
                                        <a href="javascript:;" class="del_pf_info" data-action="publish" data-id="{$vo.id}">删除</a>
                                    </div>
                                </li>
                            </volist>
                        </ul>
                        <p class="alone_size add_publish"><span class="introduce_modify">添加</span></p>
                    </div>


                    <!--资格认证-->
                    <div class="experience">
                        <p class="introduce_title" style="margin-top: 30px;">资格认证</p>
                        <ul class="certificate_ul">

                            <li class="publish_item certificate" style="display: none;">
                                <p class="tit">
                                    <i>认证名称:</i><span style="font-weight: bold;" class="certificate_name"></span>
                                </p>
                                <p class="tit">
                                    <ul style="width: 100%;margin: 0;padding: 0;">
                                        <li style="width: 300px;float: left;"><i>有效时间：</i> <span class="start_time"></span>-<span class="end_time"></span></li>
                                        <li style="width: 254px; float: left;"><i>证书编号：</i> <span class="certificate_no"></span></li>
                                        <li style="width: 262px; float: left;"><i>认证机构：</i> <span class="certification"></span></li>
                                    </ul>
                                </p>
                                <div class="xgsc">
                                    <a href="javascript:;" class="add_certificate">修改</a>
                                    <a href="javascript:;" class="del_pf_info" data-action="certificate">删除</a>
                                </div>
                            </li>

                            <volist name="pf_certificate" id="vo">
                                <li class="publish_item certificate" id="certificate_{$vo.id}">
                                    <p class="tit">
                                        <i>认证名称:</i><span style="font-weight: bold;" class="certificate_name">{$vo.certificate_name}</span>
                                    </p>
                                    <p class="tit">
                                    <ul style="width: 100%;margin: 0;padding: 0;">
                                        <li style="width: 300px;float: left;"><i>有效时间：</i> <span class="start_time">{$vo.start_time}</span>-<span class="end_time">{$vo.end_time}</span></li>
                                        <li style="width: 254px; float: left;"><i>证书编号：</i> <span class="certificate_no">{$vo.certificate_no}</span></li>
                                        <li style="width: 262px; float: left;"><i>认证机构：</i> <span class="certification">{$vo.certification}</span></li>
                                    </ul>
                                    </p>
                                    <div class="xgsc">
                                        <a href="javascript:;" class="add_certificate" data-id="{$vo.id}">修改</a>
                                        <a href="javascript:;" class="del_pf_info" data-action="certificate" data-id="{$vo.id}">删除</a>
                                    </div>
                                </li>
                            </volist>
                        </ul>
                        <p class="alone_size add_certificate"><span class="introduce_modify">添加</span></p>
                    </div>


                    <!--专利发明-->
                    <div class="publish">
                        <p class="introduce_title" style="margin-top: 30px; margin-left: -1px;">专利发明</p>

                        <div class="patent_div">
                            <div class="publish_item patent" style="display: none;">
                                <p class="tit"><i>专利名称:</i><span style="font-weight: bold;" class="patent_name"></span></p>
                                <p class="tit">
                                    <ul style="width: 100%;margin: 0;padding: 0;">
                                        <li style="width: 300px;float: left;"><i>专利国家：</i> <span class="patent_country"></span></li>

                                        <li style="width: 240px; float: left;"><i>申请时间：</i> <span class="patent_time"></span></li>
                                        <li style="width: 310px; float: left;"><i>专利号/申请号：</i> <span class="patent_no"></span></li>
                                    </ul>
                                </p>
                                <div class="xgsc">
                                    <a href="javascript:;" class="add_patent">修改</a>
                                    <a href="javascript:;" class="del_pf_info" data-action="patent">删除</a>
                                </div>
                            </div>

                            <volist name="pf_patent" id="vo">
                                <div class="publish_item patent" style="margin-left: 50px;" id="patent_{$vo.id}">
                                    <p class="tit"><i>专利名称:</i><span style="font-weight: bold;" class="patent_name">{$vo.patent_name}</span></p>
                                    <p class="tit">
                                    <ul style="width: 100%;margin: 0;padding: 0;">
                                        <li style="width: 280px;float: left;"><i>专利国家：</i> <span class="patent_country">{$vo.patent_country}</span></li>
                                        <li style="width: 228px; float: left;"><i>申请时间：</i> <span class="patent_time">{$vo.patent_time}</span></li>
                                        <li style="width: 310px; float: left;"><i>专利号/申请号：</i> <span class="patent_no">{$vo.patent_no}</span></li>
                                    </ul>
                                    </p>
                                    <div class="xgsc">
                                        <a href="javascript:;" class="add_patent" data-id="{$vo.id}">修改</a>
                                        <a href="javascript:;" class="del_pf_info" data-action="patent" data-id="{$vo.id}">删除</a>
                                    </div>
                                </div>
                            </volist>
                        </div>

                        <p class="alone_size add_patent"><span class="introduce_modify">添加</span></p>
                    </div>


                    <!--荣誉奖项-->
                    <div class="experience">
                        <p class="introduce_title">荣誉奖项</p>
                        <ul class="award_ul">
                            <li class="experience_item award" style="display: none">
                                <p class="tit"><i>奖项名称</i><span style="font-weight: bold;" class="award_name"></span></p>
                                <p  class="tit" style="margin-left:-20px;">
                                    <i style="width: 100px;">获奖时间：</i><span class="timer award_time"></span>
                                    <i style="width: 100px;">颁奖机构：</i> <span class="award_organization"></span>
                                </p>
                                <p class="tit">
                                    <i style="position: relative;top: 3px;">奖项说明:</i>
                                    <input type="text" class="input_text award_desc" readonly>
                                </p>
                                <div class="xgsc">
                                    <a href="javascript:;" class="add_award">修改</a>
                                    <a href="javascript:;" class="del_pf_info" data-action="award">删除</a>
                                </div>
                            </li>

                            <volist name="pf_award" id="vo">
                                <li class="experience_item award" id="award_{$vo.id}">
                                    <p class="tit"><i>奖项名称:</i><span style="font-weight: bold;" class="award_name">{$vo.award_name}</span></p>
                                    <p  class="tit" style="margin-left:-20px;">
                                        <i style="width: 100px;">获奖时间:</i><span class="timer award_time">{$vo.award_time}</span>
                                        <i style="width: 100px;">颁奖机构:</i><span class="award_organization">{$vo.award_organization}</span>
                                    </p>
                                    <!--<p class="tit">-->
                                        <!--<i style="position: relative;top: 3px;">奖项说明:</i>-->
                                        <!--<input type="text" class="input_text award_desc" value="{$vo.award_desc}" readonly>-->
                                    <!--</p>-->
                                    <div class="tit">
                                        <i style="position: relative;top: 3px;" >经历描述</i>
                                        <p  class="input_text project_desc ellipsis2"  readonly style="color: #333333;margin-top: -17px;border: 1px solid #707070;padding:0 5px">
                                            {$vo.award_desc}
                                        </p>
                                    </div>
                                    <div class="xgsc">
                                        <a href="javascript:;" class="add_award" data-id="{$vo.id}">修改</a>
                                        <a href="javascript:;" class="del_pf_info" data-action="award" data-id="{$vo.id}">删除</a>
                                    </div>
                                </li>
                            </volist>
                        </ul>
                        <p class="alone_size add_award"><span class="introduce_modify">添加</span></p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- /container -->
    <tc_include file="Public:footer" />
    <tc_include file="Public:scripts" />

    <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/layer/layer_1.js"></script>
    <script>

        $('#company_link_a').click(function () {
            var href        = $(this).text();
            var http_type   = window.location.protocol.split(':')[0];
            if (href.indexOf('http') < 0) {
                href = http_type + '://' + href;
            }
            window.location.href = href;
        })
        $('.modify_company').click(function () {
            $('.company_edit input').removeAttr('readonly');
            $('#company_introduction').removeAttr('readonly');
            $('#company_scale').removeAttr('readonly');

            $('#company_link').removeClass('hidden');
            $('#company_link_a').addClass('hidden');
        });
        $('.modify_company_save').click(function () {
            var user_id             = $('#user_id').val();
            var company             = $('#company').val();
            var company_link        = $('#company_link').val();
            var company_start_time  = $('#company_start_time').val();
            var company_addr        = $('#company_addr').val();
            var company_scale       = $('#company_scale').val();
            var company_introduction= $('#company_introduction').val();
            if (company && company_start_time && company_addr && company_scale && company_introduction) {
                $.post("{:U('user/profile/save_user_company_info')}",
                    {
                        id : user_id,
                        company : company,
                        company_link : company_link,
                        company_start_time : company_start_time,
                        company_addr : company_addr,
                        company_scale : company_scale,
                        company_introduction : company_introduction
                    },
                    function (re) {
                        layer.msg(re.info);
                        $('.company_edit input').attr('readonly', 'readonly');
                        $('#company_introduction').attr('readonly', 'readonly');
                        $('#company_scale').attr('readonly', 'readonly');

                        $('#company_link').addClass('hidden');
                        $('#company_link_a').attr('href', company_link);
                        $('#company_link_a').text(company_link);
                        $('#company_link_a').removeClass('hidden');
                    }
                );
            } else {
                layer.msg('请完善企业介绍');
            }
        });

        $('.submit_professor').click(function () {
            layer.confirm('确定修改吗？', {
                btn: ['确定', '取消']
            }, function (index) {
                $('#professor_form').submit();
                layer.close(index);
            });
        })

        // 动态改变项目信息
        function change_project(childWindow) {
            var id_c            = childWindow.$('input[name="id"]').val();
            var project_name    = childWindow.$('input[name="project_name"]').val();
            var start_time      = childWindow.$('input[name="start_time"]').val();
            var end_time        = childWindow.$('input[name="end_time"]').val();
            var project_desc    = childWindow.$('textarea[name="project_desc"]').val();
            end_time            = end_time ? end_time : '至今';

            var projectli       = $('#project_' + id_c);
            if (projectli.length > 0) {
                // 编辑
                projectli.find(".project_name").html(project_name);
                projectli.find(".start_time").html(start_time);
                projectli.find(".end_time").html(end_time);
                projectli.find(".project_desc").html(project_desc);
            } else {
                // 新增
                var project = $('.project').first().clone().css('display', 'block');
                project.attr('id', "project_" + id_c);
                project.find(".project_name").html(project_name);
                project.find(".start_time").html(start_time);
                project.find(".end_time").html(end_time);
                project.find(".project_desc").html(project_desc);
                project.find(".add_project").attr('data-id', id_c);
                project.find(".del_pf_info").attr('data-id', id_c);
                $('.project_ul').append(project);
            }
        }


        // 动态改变教育信息
        function change_education(childWindow) {
            var id_c            = childWindow.$('input[name="id"]').val();
            var school          = childWindow.$('input[name="school"]').val();
            var start_time      = childWindow.$('input[name="start_time"]').val();
            var end_time        = childWindow.$('input[name="end_time"]').val();
            var degree          = childWindow.$('input[name="degree"]').val();
            var major           = childWindow.$('input[name="major"]').val();
            var experience      = childWindow.$('textarea[name="experience"]').val();
            end_time            = end_time ? end_time : '至今';

            var educationli     = $('#education_' + id_c);
            if (educationli.length > 0) {
                // 编辑
                educationli.find(".school").html(school);
                educationli.find(".start_time").html(start_time);
                educationli.find(".end_time").html(end_time);
                educationli.find(".degree").html(degree);
                educationli.find(".major").html(major);
                educationli.find(".experience").html(experience);
            } else {
                // 新增
                var education = $('.education').first().clone().css('display', 'block');
                education.attr('id', "education_" + id_c);
                education.find(".school").html(school);
                education.find(".start_time").html(start_time);
                education.find(".end_time").html(end_time);
                education.find(".degree").html(degree);
                education.find(".major").html(major);
                education.find(".experience").html(experience);
                education.find(".add_education").attr('data-id', id_c);
                education.find(".del_pf_info").attr('data-id', id_c);
                $('.education_ul').append(education);
            }
        }


        // 动态改变出版作品
        function change_publish(childWindow) {
            var id_c                = childWindow.$('input[name="id"]').val();
            var article_name        = childWindow.$('input[name="article_name"]').val();
            var magazine            = childWindow.$('input[name="magazine"]').val();
            var publish_time        = childWindow.$('input[name="publish_time"]').val();
            var publish_house       = childWindow.$('input[name="publish_house"]').val();

            var publishli     = $('#publish_' + id_c);
            if (publishli.length > 0) {
                // 编辑
                publishli.find(".article_name").html(article_name);
                publishli.find(".magazine").html(magazine);
                publishli.find(".publish_time").html(publish_time);
                publishli.find(".publish_house").html(publish_house);
            } else {
                // 新增
                var publish = $('.publish_li').first().clone().css('display', 'block');
                publish.attr('id', "publish_" + id_c);
                publish.find(".article_name").html(article_name);
                publish.find(".magazine").html(magazine);
                publish.find(".publish_time").html(publish_time);
                publish.find(".publish_house").html(publish_house);
                publish.find(".add_publish").attr('data-id', id_c);
                publish.find(".del_pf_info").attr('data-id', id_c);
                $('.publish_ul').append(publish);
            }
        }

        // 动态改变资格认证
        function change_certificate(childWindow) {
            var id_c                = childWindow.$('input[name="id"]').val();
            var certificate_name    = childWindow.$('input[name="certificate_name"]').val();
            var certificate_no      = childWindow.$('input[name="certificate_no"]').val();
            var start_time          = childWindow.$('input[name="start_time"]').val();
            var end_time            = childWindow.$('input[name="end_time"]').val();
            var certification       = childWindow.$('input[name="certification"]').val();

            var certificateli       = $('#certificate_' + id_c);
            if (certificateli.length > 0) {
                // 编辑
                certificateli.find(".certificate_name").html(certificate_name);
                certificateli.find(".certificate_no").html(certificate_no);
                certificateli.find(".start_time").html(start_time);
                certificateli.find(".end_time").html(end_time);
                certificateli.find(".certification").html(certification);
            } else {
                // 新增
                var certificate = $('.certificate').first().clone().css('display', 'block');
                certificate.attr('id', "certificate_" + id_c);
                certificate.find(".certificate_name").html(certificate_name);
                certificate.find(".certificate_no").html(certificate_no);
                certificate.find(".start_time").html(start_time);
                certificate.find(".end_time").html(end_time);
                certificate.find(".certification").html(certification);
                certificate.find(".add_certificate").attr('data-id', id_c);
                certificate.find(".del_pf_info").attr('data-id', id_c);
                $('.certificate_ul').append(certificate);
            }
        }


        // 动态改变专利发明
        function change_patent(childWindow) {
            var id_c                = childWindow.$('input[name="id"]').val();
            var patent_name         = childWindow.$('input[name="patent_name"]').val();
            var patent_country      = childWindow.$('input[name="patent_country"]').val();
            var patent_no           = childWindow.$('input[name="patent_no"]').val();
            var patent_time         = childWindow.$('input[name="patent_time"]').val();

            var patentli = $('#patent_' + id_c);
            if (patentli.length > 0) {
                // 编辑
                patentli.find(".patent_name").html(patent_name);
                patentli.find(".patent_country").html(patent_country);
                patentli.find(".patent_no").html(patent_no);
                patentli.find(".patent_time").html(patent_time);
            } else {
                // 新增
                var patent = $('.patent').first().clone().css('display', 'block');
                patent.attr('id', "patent_" + id_c);
                patent.find(".patent_name").html(patent_name);
                patent.find(".patent_country").html(patent_country);
                patent.find(".patent_no").html(patent_no);
                patent.find(".patent_time").html(patent_time);
                patent.find(".add_patent").attr('data-id', id_c);
                patent.find(".del_pf_info").attr('data-id', id_c);
                $('.patent_div').append(patent);
            }
        }

        // 动态改变专利发明
        function change_award(childWindow) {
            var id_c                = childWindow.$('input[name="id"]').val();
            var award_name          = childWindow.$('input[name="award_name"]').val();
            var award_organization  = childWindow.$('input[name="award_organization"]').val();
            var award_time          = childWindow.$('input[name="award_time"]').val();
            var award_desc          = childWindow.$('textarea[name="award_desc"]').val();

            var awardli = $('#award_' + id_c);
            if (awardli.length > 0) {
                // 编辑
                awardli.find(".award_name").html(award_name);
                awardli.find(".award_organization").html(award_organization);
                awardli.find(".award_time").html(award_time);
                awardli.find(".award_desc").val(award_desc);
            } else {
                // 新增
                var award = $('.award').first().clone().css('display', 'block');
                award.attr('id', "patent_" + id_c);
                award.find(".award_name").html(award_name);
                award.find(".award_organization").html(award_organization);
                award.find(".award_time").html(award_time);
                award.find(".award_desc").val(award_desc);
                award.find(".add_award").attr('data-id', id_c);
                award.find(".del_pf_info").attr('data-id', id_c);
                $('.award_ul').append(award);
            }
        }

        $(function () {

            $('body').delegate('.del_pf_info', 'click', function () {
                var action  = $(this).attr('data-action');
                var id      = $(this).attr('data-id');

                layer.confirm('确认删除？', {
                    btn: ['确定','取消'] //按钮
                }, function(index){
                    var url = "/index.php?g=professor&m=professor&a=pf_" + action + "_edit";
                    $.post(url, {delete : 1, id : id}, function (data) {
                        if (data.status) {
                            $('#' + action + "_" + id).remove();
                            layer.close(index);
                        } else {
                            layer.msg(data.info);
                        }
                    });
                });
            });


            // 项目经历
            $('body').delegate('.add_project', 'click', function () {
                var id = $(this).attr('data-id');
                layer.open({
                    title: "项目",
                    type: 2,
                    area: ['60%', '60%'],
                    btn: ['确定', '取消'],
                    content: "{:U('professor/professor/pf_project_edit')}" + "&id=" + id,
                    yes:function (index, layerC) {
                        // 子窗口
                        var content = layerC.find("iframe")[0].contentWindow;
                        content.$('.js-ajax-forms').submit();
                    }
                });
            });


            // 教育经历
            $('body').delegate('.add_education', 'click', function () {
                var id = $(this).attr('data-id');
                layer.open({
                    title: "教育",
                    type: 2,
                    area: ['60%', '60%'],
                    btn: ['确定', '取消'],
                    content: "{:U('professor/professor/pf_education_edit')}" + "&id=" + id,
                    yes: function(index, layerC) {
                        // 子窗口
                        var content = layerC.find("iframe")[0].contentWindow;
                        content.$('.js-ajax-forms').submit();
                    }
                });
            });

            // 出版作品
            $('body').delegate('.add_publish', 'click', function () {
                var id = $(this).attr('data-id');
                layer.open({
                    title: "出版作品",
                    type: 2,
                    area: ['60%', '60%'],
                    btn: ['确定', '取消'],
                    content: "{:U('professor/professor/pf_publish_edit')}" + "&id=" + id,
                    yes: function(index, layerC) {
                        // 子窗口
                        var content = layerC.find("iframe")[0].contentWindow;
                        content.$('.js-ajax-forms').submit();
                    }
                });
            });

            // 资格认证
            $('body').delegate('.add_certificate', 'click', function () {
                var id = $(this).attr('data-id');
                layer.open({
                    title: "资格认证",
                    type: 2,
                    area: ['60%', '60%'],
                    btn: ['确定', '取消'],
                    content: "{:U('professor/professor/pf_certificate_edit')}" + "&id=" + id,
                    yes: function(index, layerC) {
                        // 子窗口
                        var content = layerC.find("iframe")[0].contentWindow;
                        content.$('.js-ajax-forms').submit();
                    }
                });
            });


            // 专利发明
            $('body').delegate('.add_patent', 'click', function () {
                var id = $(this).attr('data-id');
                layer.open({
                    title: "专利发明",
                    type: 2,
                    area: ['60%', '60%'],
                    btn: ['确定', '取消'],
                    content: "{:U('professor/professor/pf_patent_edit')}" + "&id=" + id,
                    yes: function(index, layerC) {
                        // 子窗口
                        var content = layerC.find("iframe")[0].contentWindow;
                        content.$('.js-ajax-forms').submit();
                    }
                });
            });

            // 荣誉奖项
            $('body').delegate('.add_award', 'click', function () {
                var id = $(this).attr('data-id');
                layer.open({
                    title: "专利发明",
                    type: 2,
                    area: ['60%', '60%'],
                    btn: ['确定', '取消'],
                    content: "{:U('professor/professor/pf_award_edit')}" + "&id=" + id,
                    yes: function(index, layerC) {
                        // 子窗口
                        var content = layerC.find("iframe")[0].contentWindow;
                        content.$('.js-ajax-forms').submit();
                    }
                });
            });
        })
    </script>

</body>
<style>
    .publish_item{margin-left: 55px;border:1px solid #efefef;width: 818px;height: 80px; padding: 12px 16px; font-size: 18px;position: relative;border-radius: 10px;margin-bottom: 10px;}
    .publish_item .tit i {width: 80px;display: inline-block;margin-bottom: 20px;}
    .publish_item .tit li{float: left;}
    .alone_btm {margin-bottom: 90px;}
    .alone_btm span {width: 60px;height: 30px;border-radius:10px;display: inline-block;text-align: center;line-height: 30px; font-weight: bold;letter-spacing: 2px;margin-top: 20px;margin: 45px;}
    .alone_btm1{color: #FFF;background-color: #000232;}
    .alone_btm2{color: #000232;background-color: #fff;border: 1px solid #000232;}

    *{margin: 0; padding: 0; font-family:Microsoft YaHei; }
    .fl{float: left;}
    .fr{float: right;}
    li{list-style: none; }
    a{text-decoration:none; color:  #333333; }
    i {font-style: normal;}
    .alone_center{width: 830px; }
    .alone_right{width: 830px; float: right; }
    .introduce {margin-top: 34px;}
    .alone_right .introduce_title {font-size: 22px;color: #a9a9a9;padding-left: 20px;margin-bottom: 20px;}
    .alone_right .introduce_text {margin-left: 60px;width: 818px;height: 380px;padding:8px 6px 0px;border-radius: 10px;font-size: 18px;}
    .alone_size {padding-left: 10px;}
    .introduce_modify {width: 60px;height: 30px;border-radius:10px;color: #FFF;background-color: #000232;display: inline-block;text-align: center;line-height: 30px; font-weight: bold;letter-spacing: 2px;margin-left: 90px;margin-top: 20px;}
    .experience{padding: 34px 0 15px;}
    .experience_item {margin-left: 53px;padding: 24px 15px 20px 0;border: 1px solid #efefef;width: 818px;position: relative;margin-bottom: 10px;border-radius: 10px;}
    .experience_item .tit {font-size: 18px; color: #333;margin-bottom:16px;}
    .experience_item .tit i {display: inline-block;width: 80px;text-align: right;margin-right: 10px;}
    .tit i, .publish_item i {
        font-size: 14px;
        color: #333333;
    }
    .enterprise input {
        border: none;
        padding-left: 5px;
        font-size: 16px;
    }
    .enterprise textarea {
        font-size: 16px;
    }

    .tit .timer{display: inline-block;width: 114px;height: 30px;border: 1px solid #707070;margin-right: 16px;line-height: 30px;padding: 2px 5px;}
    .tit .input_text { font-size: 16px;
        line-height: 24px;  width: 720px;height: 50px;padding: 3px 5px;margin-left: 90px;margin-top: -16px;word-wrap: break-word;word-break: break-all;overflow: hidden;}
    .xgsc{font-size: 18px;position: absolute;top: 8px;right: 8px;color: #000232;}
    .xgsc a {color: #668fe6;padding-right: 10px;}
</style>
</html>